package com.example.testspringes.testfan;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @Description: //TODO
 * @ProjectName: testspringes
 * @Package: com.example.testspringes.testfan
 * @Author: FX
 * @CreateDate: 2019/3/29 14:07
 * @Version: 1.0
 * Copyright: Copyright (c) 2019
 */
public class ListUtils<T> {

    public static <T>List<T> removeSame(List<T> c){
       return c.stream().distinct().collect(Collectors.toList());
    }



    public static <T>List<T> distinctByANewList(List<T> list){
        List<T> newList = new ArrayList<>();
        for(T t : list){
            if(!newList.contains(t)){
                newList.add(t);
            }
        }
        return newList;
    }
    //public static <T>List<T>

}
